<template>
  <div class="box">
    <van-nav-bar title="票夹">
      <template #right>
        <van-icon name="ellipsis" @click="showMark" />
      </template>
    </van-nav-bar>
    <van-overlay :show="show">
      <div class="wrapper" @click="closeMark">
        <div class="block">
          <div @click="goHome">
            <van-icon name="wap-home-o" class="block_icon" />
            <span>主页</span>
          </div>
          <div @click="goUser">
            <van-icon name="contact" class="block_icon" />
            <span>我的聚橙</span>
          </div>
        </div>
      </div>
    </van-overlay>
    <div class="wallet">
      <img src="https://m.juooo.com/static/img/ticket_empty.cf4b072.png" alt="">
      <p>暂无电子票</p>
    </div>
  </div>
</template>

<script>
import Vue from 'vue'
import { Icon, NavBar, Overlay } from 'vant'
Vue.use(NavBar)
Vue.use(Icon)
Vue.use(Overlay)
export default {
  data () {
    return {
      show: false
    }
  },
  mounted () {},
  methods: {
    showMark () {
      this.show = true
    },
    closeMark () {
      this.show = false
    },
    goHome () {
      this.$router.push('/home')
    },
    goUser () {
      if (localStorage.getItem('loginState') !== 'ok') {
        this.$router.push('/login')
      } else {
        this.$router.push('/user')
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.wrapper {
  display: flex;
  position: relative;
  height: 100%;
}
.block {
  width: 1.40rem;
  height: 0.90rem;
  position: absolute;
  top: 0.40rem;
  right: 0.05rem;
  border-radius: 0.05rem;
  background-color: #fff;
  div {
    width: 100%;
    height: 0.44rem;
    line-height: 0.44rem;
    .block_icon {
      font-size: 0.20rem;
      margin: 0 0.13rem;
      float: left;
      margin-top: 0.10rem;
    }
    span {
      float: left;
    }
  }
  div:nth-of-type(1) {
    border-bottom: 1px solid #f2f2f2;
  }
}
.wallet {
  width: 100%;
  height: auto;
  img {
    width: 1.10rem;
    height: 0.77rem;
    display: block;
    margin: 1.40rem auto 0.22rem auto;
  }
  p {
    text-align: center;
    height: 0.18rem;
    line-height: 0.18rem;
    font-size: 0.12rem;
    color: #999999;
  }
}
/deep/ .van-nav-bar {
  border-bottom: 1px solid #ebebeb;
}
/deep/ .van-icon-ellipsis {
  font-size: 0.20rem;
  color: #232323;
}
</style>
